﻿<?xml version="1.0" encoding="utf-8" ?>

<log4net>
  <!-- Define some output appenders -->
  <appender name="ConsoleAppender" type="log4net.Appender.ColoredConsoleAppender" >

    <mapping>
      <level value="ERROR" />
      <foreColor value="White" />
      <backColor value="Red, HighIntensity" />
    </mapping>

    <mapping>
      <level value="FATAL" />
      <foreColor value="White" />
      <backColor value="Red" />
    </mapping>

    
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
    </layout>
  </appender>

  <appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
    <file value="C:\tmp\example.log" />
    <appendToFile value="false" />
    <maximumFileSize value="4096KB" />
    <!-- <maxSizeRollBackups value="2" /> -->
    <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
    <rollingStyle value="Date" />
    <!--   for every min rolling use yyyyMMdd-HHmm-->
    <datePattern value="yyyyMMdd-HH" />

    <layout type="log4net.Layout.PatternLayout">      
      <conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
    </layout>
  </appender>

  
  
  <!-- Setup the root category, add the appenders and set the default level -->
  <root>
    <level value="DEBUG" />
    <appender-ref ref="ConsoleAppender" />
    <appender-ref ref="RollingFile" />
  </root>

  <logger name="FatalOnlyLogs">
    <level value="FATAL" />
    <appender-ref ref="ConsoleAppender" />
  </logger>

</log4net>